{% set repositories = namespace(repositories=[]) %}
{% for repository in hacs.sorted_by_name %}
{% if repository.status.new %}
{% set repositories.repositories = repositories.repositories+[repository] %}
{% endif %}
{% endfor %}
{% if repositories.repositories %}
<div class='hacs-overview-container'>
  <h5>NEW REPOSITORIES (ALL)</h5>
  <form action="/hacsapi/{{ hacs.token }}/remove_new_flag" name="remove_new_flag" method="post" accept-charset="utf-8"
    enctype="application/x-www-form-urlencoded" class="hacs-form">
    <input type="hidden" name="return" value="store">
    <a class="waves-effect waves-light btn modal-trigger hacsbutton" href="#"
      onclick="toggleLoading();document.getElementsByName('remove_new_flag')[0].submit()" style="width: 95%;">
      Remove the NEW flag for all new items
    </a>
  </form>
  <div class='hacs-card-container'>
    {% for repository in repositories.repositories %}
    <a href="/hacsweb/{{ hacs.token }}/repository/{{ repository.information.uid }}?timestamp={{ timestamp }}"
      class="hacs-card" onclick="toggleLoading()">
      <div class="hacs-card overview">
        <div id="statusicon">

        </div>
        <div id="title">
          <span class="hacs-card-title">
            <span class="hacs-badge">
              {{repository.information.category | upper}}
            </span>
            </br></br>
            {{repository.display_name}}
          </span>
        </div>
        <div id="description">
          <span class="hacs-card-content">
            <p>{{repository.information.description}}</p>
          </span>
        </div>
      </div>
    </a>
    {% endfor %}
  </div>
</div>
</br>
</br>
{% endif %}